
<div id="main-content"> <!-- Main Content Section with everything -->			
	<!-- Page Head -->			
	<ul class="shortcut-buttons-set">				
		<li><a class="shortcut-button" href="<?php echo base_url();?>dhcp/new_dhcp"><span>
			<img src="<?php echo base_url();?>images/icons/image_add_48.png" alt="icon" /><br />
			New
		</span></a></li>
		
		<li><a class="shortcut-button" href="<?php echo base_url();?>dhcp/download"><span>
			<img src="<?php echo base_url();?>images/icons/clock_48.png" alt="icon" /><br />
			Downdoload
		</span></a></li>
	</ul><!-- End .shortcut-buttons-set -->
	<form name='search' method='get' action=''>
		<label>关键词：</label>
		<input class="text-input" id='key' type='text' name='key' value='<?php echo $key?$key:'';?>' />
		<select name="options" >
			<option value="host" <?php echo $options=='host'?'selected':'';?>>Host</option>
			<option value="mac" <?php echo $options=='mac'?'selected':'';?>>Mac</option>
			<option value="ip" <?php echo $options=='ip'?'selected':'';?>>Ip</option>
			<option value="name" <?php echo $options=='name'?'selected':'';?>>员工姓名</option>
		</select> 
		<input class="button" type='submit' value='搜索' />
		<input class='reset button' type='button' value='重置'/>
	</form>				
	<div class="clear"></div> <!-- End .clear -->
	
	<div class="content-box"><!-- Start Content Box -->
		
		<div class="content-box-header">
			
			<h3>DHCP</h3>					
			<div class="clear"></div>
			
		</div> <!-- End .content-box-header -->
		
		<div class="content-box-content">
			
			<div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->						
				<table>
					
					<thead>
						<tr>
						   
						   <th>No.</th>
						   <th>Host</th>
						   <th>Mac</th>
						   <th>Ip</th>
						   <th>员工姓名</th>
						   <th>部门</th>
						   <th>Operation</th>
						</tr>
						
					</thead>
				 
					<tfoot>
						<tr>
							<td colspan="7">										
								<div class="pagination">
									<?php echo $page;?><!-- 分页 -->										
								</div> <!-- End .pagination -->
								<div class="clear"></div>
							</td>
						</tr>
					</tfoot>
				 
					<tbody>
					<?php $i=0; foreach($query as $row):?>
						<?php 
							$note = explode('-',$row['note']);
							switch(count($note)){
								case '0':
									$host = $name = $unit = '未分配';
									break;
								case '1':
									$host = $note[0];
									$name = $unit = '未分配';
									break;
								case '2':
									$host = $note[0];
									$name = $note[1];
									$unit = '未分配';
									break;
								case '3';
									$host = $note[0];
									$name = $note[1];
									$unit = $note[2];
							}
						?>
						<tr>									
							<td><?php $i++;echo $i;?></td>
							<td><?php echo $row['host']?$row['host']:$host;?></td>
							<td><?php echo $row['mac'];?></td>
							<td><?php echo $row['ip'];?></td>
							<td><?php echo $row['name']?$row['name']:$name;?></td>
							<td><?php echo $row['unit']?$row['unit']:$unit;?></td>
							<td>
								<!-- Icons -->
								 <a href="<?php echo base_url()?>dhcp/modify_dhcp/<?php echo $row['id'];?>" title="Edit"><img src="<?php echo base_url()?>images/icons/pencil.png" alt="Edit" /></a>
								 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								 <a href="<?php echo base_url()?>dhcp/del_dhcp/<?php echo $row['id'];?>" title="Delete" onclick='return del()'><img src="<?php echo base_url()?>images/icons/cross.png" alt="Delete" /></a> 
							</td>
						</tr>
					<?php endforeach;?>	
					</tbody>
					
				</table>
				
			</div> <!-- End #tab1 -->
			

			
		</div> <!-- End .content-box-content -->
		
	</div> <!-- End .content-box -->
	<div class="clear"></div>			
</div> <!-- End #main-content -->	
